Reuse computed checksums across retries#6413
Merged
dagnir merged 3 commits intofeature/master/checksum-reusefrom Sep 19, 2025
Merged
Reuse computed checksums across retries#6413dagnir merged 3 commits intofeature/master/checksum-reusefrom
dagnir merged 3 commits intofeature/master/checksum-reusefrom
Conversation
731a921 to
344a525
Compare
344a525 to
1754544
Compare
This commit adds the ability to reuse previously computed checksums for a request across retries. This ensures that if a request data stream is modified between attempts that the server will reject the request. As part of this change, the `http-auth-spi` package has been updated to expose a new interface: `PayloadChecksumStore`. This is a simple storage interface that allows signers to store and retrieve computed checksums. Additionally, a new `SignerProperty` is introduced, `SdkInternalHttpSignerProperty.CHECKSUM_CACHE` so that signers and their callers can access this cache. Note that both the interface and associated signer property are `@SdkProtectedApi` and not intended to be used by non-SDK consumers of `http-auth-spi`. Finally, this adds a dependency on `checksums-spi` for `http-auth-spi`.
1754544 to
2412e29
Compare
davidh44
approved these changes
Sep 12, 2025
S-Saranya1
approved these changes
Sep 18, 2025
…al/http/pipeline/stages/SigningStage.java Co-authored-by: David Ho <70000000+davidh44@users.noreply.github.com>
zoewangg
reviewed
Sep 18, 2025
| */ | ||
| @SdkInternalApi | ||
| @SuppressWarnings("deprecation") | ||
| public class LegacyPayloadChecksumCache { |
Contributor
There was a problem hiding this comment.
Do we want to add cache for legacy path, i.e., customers using legacy custom signers?
Contributor
Author
There was a problem hiding this comment.
Good callout. Actually nothing is using this class for now. I will follow up with another PR for legacy.
zoewangg
approved these changes
Sep 18, 2025
|
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Motivation and Context
This commit adds the ability to reuse previously computed checksums for a request across retries.
This ensures that if a request data stream is modified between attempts that the server will reject the request.
As part of this change, the
http-auth-spipackage has been updated to expose a new interface:PayloadChecksumStore. This is a simple storage interface that allows signers to store and retrieve computed checksums. Additionally, a newSignerPropertyis introduced,SdkInternalHttpSignerProperty.CHECKSUM_CACHEso that signers and their callers can access this cache.Note that both the interface and associated signer property are
@SdkProtectedApiand not intended to be used by non-SDK consumers ofhttp-auth-spi.Finally, this adds a dependency on
checksums-spiforhttp-auth-spi.Note: this PR only adds support in the sync codepath. Will follow up with async (merging to a feature branch).
Modifications
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License